package cn.yunhe.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * Created by zs on 2017/12/15.
 */
@Controller
@RequestMapping("/hi")
public class HelloController {

    @RequestMapping(value = "/hello")
    public ModelAndView hello() {
        ModelAndView mv = new ModelAndView();
        mv.addObject("message", "hello  annotation");
        mv.setViewName("hello");
        return mv;
    }


    @RequestMapping("/toLogin")
    public ModelAndView hi() {
        ModelAndView mv = new ModelAndView();
        mv.setViewName("/login.jsp");
        return mv;
    }


}
